<template>
	<view>
	<!-- 	<map style="width: 100%; height: 300px;"  >
						</map> -->
						<map :latitude="addrDel.latitude" :longitude="addrDel.longitude" @markertap="clickMarkertap" :markers="markers"   style="width: 100%; height: calc(100vh - 170upx);" ></map>
						<u-popup custom-class="demo-popup" position="bootom" :show="visible">
							
						</u-popup>
		<TabBar :tabBarShow="2"></TabBar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				visible:false,
				addrDel:{
					  
				},
				markers:[
					{
						latitude: 34.79987,
						longitude: 113.66072,
						iconPath :'/static/tabBar/fb-current.png',
						id:1
					},
					{
						latitude: 34.79987,
						longitude: 113.66172,
						iconPath :'/static/tabBar/fb-current.png',
						id:2
					},
				]
			}
		},
		// 分享好友
		onShareAppMessage() {
			return {
			      title: '鲸算网云',
			      path: JSON.parse(uni.getStorageSync('gitH5Qrcode')), 
			    }
		},
		// 分享朋友圈
		onShareTimeline(){
			return {
			      title: '鲸算网云',
			      query: JSON.parse(uni.getStorageSync('gitH5Qrcode')), 
			    }
		},
		onLoad() {
			let that = this
			// uni.getSystemInfo({
			// 	success(res) {
			// 		if(!res.locationEnabled || !res.locationAuthorized){
			// 			uni.showToast({title: '请确保手机系统定位已开启',icon: 'none',duration: 2000,})
			// 		}
			// 	}
			// 	})
			uni.getLocation({
						    type: 'wgs84',
							geocode:true,//设置该参数为true可直接获取经纬度及城市信息
						    success:  (res)=> {
								that.addrDel = res;
						    },
							fail: function () {
								uni.showToast({
								    title: '获取地址失败，将导致部分功能不可用',
									icon:'none'
								});
							}
						});
		},
		methods: {
			clickMarkertap(e){
				console.log(e)
				this.visible = true
			}
		}
	}
</script>

<style>

</style>
